 @include "nearest.awk"
 @include "lib.awk"
 @include "bootbins.awk"
 function _neared()    { nnk1("weathern") }
 function desharnais() { nnk1("desharnais") }
 function nnk1(f0,logp,display,min,max,    out,key,f,bins) {
   logp    = isNum(logp,0)
   display = isNum(display,30)
   min     = isNum(min,0)
   max     = isNum(max,100)
   f       = "cat " data(f0 ".csv")
   key     = logp f0
   nearest(f, logp, key,out)
   printf key"," 
   tiles(out[key],display ,min,max, ", %4.2f","0.25,0.5,0.5,0.5,0.75")
   
 }
 function xx(    out) {
     array(_D); nnk1("albrecht",     1,30,0,2,out)
     array(_D); nnk1("albrecht",     0,30,0,2,out)
     array(_D); nnk1("albrechtNoLOC",1,30,0,2,out)
     array(_D); nnk1("albrechtNoLOC",0,30,0,2,out)
     bootbins("%s , %s ,%s\n",out)
 }
 function logOrNot(f,    out) {
     array(_D); nnk1(f,     1,30,0,2,out)
     array(_D); nnk1(f,     0,30,0,2,out)
     bootbins("%s , %s ,%s\n",out)
 }
 function logOrNots() {
   logOrNot("albrecht")
   logOrNot("coc81")
   logOrNot("desharnais")
   logOrNot("nasa93")
   logOrNot("china")
   }
 function toNorNot2N(  out) {
     array(_D); nnk1("nasa93",          1,30,0,1,out)
     array(_D); nnk1("nasa93",          0,30,0,1,out)
     array(_D); nnk1("nasa93n",         1,30,0,1,out)
     array(_D); nnk1("nasa93n",         0,30,0,1,out)
     bootbins("%s , %s ,%s\n",out)
 }
